﻿using RestSharp;
using ServiceStack.Text;
using System;
using System.Web;
using Ymatou.ServiceCenter;
using Ymatou.User.Dto.Auth;
using YmtAuth.AppService;
using YmtAuth.Domain.Shard;
using YmtAuth.Dto;
using YmtSystem.CrossCutting;
using ResetService = ServiceStack.Service;

namespace YmtAuth.Web.Handlerv2
{
    /// <summary>
    /// 处理对用户凭据的更新事件、密码更新事件的查询请求
    /// </summary>
    public class UserBillsEventHandler : ResetService
    {
        private IUserBillsAppService UserBillsEventService { get { return LocalServiceLocator.GetService<IUserBillsAppService>(); } }

        //java
        [ServiceRegister("/json/reply/UserBillsPasRequestDto", Method.GET)]
        public object Get(UserBillsPasRequestDto request)
        {

            HttpContext.Current.Request.Headers.Add(YmtUserKey.RequestId, Guid.NewGuid().ToString("N"));
            HttpContext.Current.Request.Headers.Add(YmtAuthSafeConstant.ApiId, YmtAuthSafeConstant.Api_login);

            return UserBillsEventService.GetLastUpdatedTimeForPas(request, Request);
        }
    }
}